message("compile JsonCpp")

aux_source_directory(./include  INSTALL_HEAD_FILES)
#set(INSTALL_HEAD_FILES ./include/json/*)

include_directories(./include)

set(JSONCPP_SOURCES ./src/json_tool.h ./src/json_reader.cpp ./src/json_value.cpp ./src/json_writer.cpp)



ADD_LIBRARY(json SHARED ${JSONCPP_SOURCES})

install(TARGETS json
        EXPORT MyLibTargets 
        LIBRARY DESTINATION lib  # 动态库安装路径
        ARCHIVE DESTINATION lib  # 静态库安装路径
        RUNTIME DESTINATION bin  # 可执行文件安装路径
        PUBLIC_HEADER DESTINATION include  # 头文件安装路径
        )

#install(FILES ./include/* DESTINATION  ${CMAKE_INSTALL_PREFIX}/include/)
install(DIRECTORY ./include/json DESTINATION  ${CMAKE_INSTALL_PREFIX}/include/)



